package com.tiamo.traders.controller;

import com.tiamo.traders.entity.Job;
import com.tiamo.traders.service.JobService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/tiamo/job")
public class JobController {
    @Autowired
    JobService jobService;

    @RequestMapping("/add")
    public int add(Job job) {
        return jobService.add(job);
    }

    @RequestMapping("/update")
    public int update(Job job) {
        return jobService.update(job);
    }

    @RequestMapping("/delete")
    public int delete(Job job) {
        return jobService.delete(job);
    }

    @RequestMapping("/findAll")
    public List<Job> findAll(Job job) {
        return jobService.findAll(job);
    }

    @RequestMapping("/findById")
    public Job findById(Job job) {
        return jobService.findById(job);
    }

    @RequestMapping("/getCount")
    public int getCount(Job job) {
        return jobService.getCount(job);
    }
}
